#ifndef __ALU_ADD_H__
#define __ALU_ADD_H__

#include "LRF.h"
#include <queue>

#define UCHAR_MIN 0

using namespace std;

typedef struct ALU_ADD_ENTRY{
	int inputA;
	int inputB;
	float inputFA;
	float inputFB;
	int OpCode;
	int regDst;
	int CyclesLeft;
	bool Ready;
	int outputZ;
	float outputFZ;
} ALU_ADD_ENTRY;

//ALU ADD
class ALU_ADD
{

public:
	ALU_ADD();

	int   OpCode;
	int   inputA;
	int   inputB;
	int   regDst;

	float inputFA;      //Floating point, not supported
	float inputFB;      //Floating point, not supported

	LRF * fu_lrf;

	bool  isReady();
	bool  isFinished();
	void  update();
	int   getOutput();
	float getOutputF(); //Floating point, not supported

private:
	int   CyclesLeft;
	bool  Ready;
	int   outputZ;
	float outputFZ;     //Floating point, not supported
	queue<ALU_ADD_ENTRY> add_pipeline;
	void update_queue();
};

#endif /* ifndef __ALU_ADD_H__ */
